<?php
/**
* @version		$Id: mod_seyretaio;
* @copyright	Copyright (C) 2010 Mustafa Dindar. All rights reserved.
* @license		GNU/GPL http://www.joomlaholic.com/gpl-2.0.txt
*/
defined('_JEXEC') or die('Restricted access'); 


$document = & JFactory::getDocument();
$csslink=JURI :: root()."modules/mod_seyretaio/assets/style.css";
$document->addStyleSheet($csslink);



$row=0;
$columnnow=1;

foreach ($videos as $video) {
if ($row == 0){$bgcolnew=$bgcol0;} else {$bgcolnew = $bgcol1;}
?>
	<div style="width:<?php echo $columnwidth;?>px; background-color:<?php echo $bgcolnew; ?>; border:<?php echo $borderwidth; ?> <?php echo $bordertype; ?> <?php echo $bordercolor; ?>;" class="aiomodrowcommonal<?php echo $videodetails;?> aiomodrowcommon aiomodrow<?php echo $row; ?>">
		<div class="aiomodtitle">
			<a href="<?php echo $video->videolink; ?>"  style="color: <?php echo $titlecolor ?>;" title="<?php echo $video->videotitle; ?>">
				<?php echo substr($video->videotitle,0,$videotitlelenght); ?>
			</a>
		</div>		
		<div class="aiomodvideoinfo1<?php echo $videodetails;?>" >
			<?php
			if ($displaytype=="thumbnail") {
			
			?>
			<a href="<?php echo $video->videolink; ?>">
				<img src="<?php echo htmlentities($video->videothumbnail); ?>" class="aiomodvideothumbnail aiomodarrangement<?php echo $arrangement; ?>" alt="" width="<?php echo $thumbwidth; ?>" height="<?php echo $thumbheight; ?>"/>
			</a>
			
			<?php
			} else if ($displaytype=="player") {
			
			?>
			<div style="width<?php echo $columnwidth;?>px; height:<?php echo (($columnwidth/4)*3) + 25;?>px;">
			<script src="<?php echo JURI :: root();?>components/com_seyret/includes/js/seyretvembed.js?plcsp=<?php echo $video->plcspfile;?>&amp;videoid=<?php echo $video->id;?>&amp;width=<?php echo $columnwidth;?>&amp;height=<?php echo (($columnwidth/4)*3) + 25;?>&amp;thumb=<?php echo urlencode ($video->videothumbnail) ; ?>" type="text/javascript"></script>		
			</div>
			<?php
			
			}
			
			
			?>
			

		</div>
		
		
		<?php if ($videodetails!="nodetails") {
?>
		<?php if ($videodetails=="bottom") echo "<div style='clear:both;'></div>" ?>
		<div class="aiomodvideoinfo2<?php echo $videodetails;?> ">
			<?php if ($showrating == "1" ) {
			?>
			<div class="aiomoddetailsrow"  style="color: <?php echo $detailscolor ?>;">
				<div class="aiomodvotestarsmc">
					<div style="float:left;"><?php echo JText::_('Rating') ?> : </div>
					<?php echo str_replace("rating", "aiomodrating", $video->votestars); ?>
					<div style="clear:both;"></div>
				</div>	
				<div style="clear:both;"></div>				
			</div>
	
			<?php
			}
			?>


			<?php if ($showvideoowner == "1" ) {
			?>
			<div class="aiomoddetailsrow" style="color: <?php echo $detailscolor ?>;">

				<div style="float:left;"><?php echo JText::_('Added by') ?> : </div>
				<?php echo $video->usernamelinked; ?>


				<div style="clear:both;"></div>				
			</div>
	
			<?php
			}
			?>

			<?php if ($showhit == "1" ) {
			?>
			<div class="aiomoddetailsrow"  style="color: <?php echo $detailscolor ?>;">

				<div style="float:left;"><?php echo JText::_('Views') ?> : </div>
				<?php echo $video->hits; ?>


				<div style="clear:both;"></div>				
			</div>
	
			<?php
			}
			?>


			<?php if ($showaddeddate == "1" ) {
			?>
			<div class="aiomoddetailsrow"  style="color: <?php echo $detailscolor ?>;">

				<div style="float:left;"><?php echo JText::_('Date') ?> : </div>
				<?php echo $video->addeddate; ?>


				<div style="clear:both;"></div>				
			</div>
	
			<?php
			}
			?>
			
		</div>
		
		
<?php
		}
		
		
		?>

	</div>


<?php
	if ($row==0) {
		$row=1;
	} else {
		$row=0;
	}
	
	
	
	if ($columncount==$columnnow )	{
		echo "<div style='clear:both;'></div>";
		$columnnow=1;
	} else {
		$columnnow ++;
		
	}

	
}


?>


<div style="clear:both;"></div>